const mongoose = require('mongoose');
const DB_URL = 'mongodb://127.0.0.1:27017/rc-admin';
mongoose.connect(DB_URL, { useMongoClient: true });
mongoose.Promise = global.Promise;
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.on('connected', () => {
  console.log('mongodb 连接成功...')
});

module.exports = db;